import Layout from '@/layout'

const orgRouter = {
  path: '/org',
  component: Layout,
  name: 'org_mgr',
  redirect: '/org/dept/list',
  meta: { title: '机构管理', icon: 'org', permissions: ['org:dept:list', 'org:user:list'] },
  children: [
    {
      path: 'dept',
      component: () => import('@/views/org/dept/index'),
      name: 'dept_mgr',
      meta: { title: '部门管理', permissions: ['org:dept:list'] },
      redirect: 'list',
      children: [
        {
          path: 'list',
          component: () => import('@/views/org/dept/list'),
          name: 'dept_mgr_list',
          meta: { title: '部门管理', icon: 'ljm-dept', permissions: ['org:dept:list'] }
        },
        {
          path: 'add',
          component: () => import('@/views/org/dept/add'),
          name: 'dept_mgr_add',
          meta: { title: '新增部门', permissions: ['org:dept:add'] },
          hidden: true
        },
        {
          path: 'edit',
          component: () => import('@/views/org/dept/edit'),
          name: 'dept_mgr_edit',
          meta: { title: '修改部门', permissions: ['org:dept:edit'] },
          hidden: true
        },
        {
          path: 'view',
          component: () => import('@/views/org/dept/view'),
          name: 'dept_mgr_view',
          meta: { title: '部门信息', permissions: ['org:dept:view'] },
          hidden: true
        }
      ]
    },
    {
      path: 'user',
      component: () => import('@/views/org/user/index'),
      name: 'user_mgr',
      meta: { title: '用户管理', permissions: ['org:user:list'] },
      redirect: 'list',
      children: [
        {
          path: 'list',
          component: () => import('@/views/org/user/list'),
          name: 'user_mgr_list',
          meta: { title: '用户管理', icon: 'ljm-user', permissions: ['org:user:list'] }
        },
        {
          path: 'add',
          component: () => import('@/views/org/user/add'),
          name: 'user_mgr_add',
          meta: { title: '新增用户', permissions: ['org:user:add'] },
          hidden: true
        },
        {
          path: 'edit',
          component: () => import('@/views/org/user/edit'),
          name: 'user_mgr_edit',
          meta: { title: '修改用户', permissions: ['org:user:edit'] },
          hidden: true
        },
        {
          path: 'view',
          component: () => import('@/views/org/user/view'),
          name: 'user_mgr_view',
          meta: { title: '用户信息', permissions: ['org:user:view'] },
          hidden: true
        }
      ]
    }
  ]
}

export default orgRouter
